home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / cabal.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  20KB  |  598 lines

  1. /******************************************************************
  2. Cabal Bootleg
  3. (c)1998 Red Corp
  4.  
  5. driver by Carlos A. Lozano Baides
  6.  
  7. 68000 + Z80
  8.  
  9. The original uses 2xYM3931 for sound
  10. The bootleg uses YM2151 + 2xZ80 used as ADPCM players
  11.  
  12. MEMORY MAP
  13. 0x000000 - 0x03ffff   ROM
  14. 0x040000 - 0x0437ff   RAM
  15. 0x043800 - 0x0437ff   VRAM (Sprites)
  16. 0x060000 - 0x0607ff   VRAM (Tiles)
  17. 0x080000 - 0x0803ff   VRAM (Background)
  18. 0x0A0000 - 0xA0000f   Input Ports
  19. 0x0C0040 - 0x0c0040   Watchdog??
  20. 0x0C0080 - 0x0C0080   Watchdog??
  21. 0x0E0000 - 0x0E07ff   COLORRAM (----BBBBGGGGRRRR)
  22. 0x0E8000 - 0x0E800f   Output Ports/Input Ports
  23.  
  24. VRAM(Background)
  25. 0x80000 - 32 bytes (16 tiles)
  26. 0x80040 - 32 bytes (16 tiles)
  27. 0x80080 - 32 bytes (16 tiles)
  28. 0x800c0 - 32 bytes (16 tiles)
  29. 0x80100 - 32 bytes (16 tiles)
  30. ...
  31. 0x803c0 - 32 bytes (16 tiles)
  32.  
  33. VRAM(Tiles)
  34. 0x60000-0x607ff (1024 tiles 8x8 tiles, 2 bytes every tile)
  35.  
  36. VRAM(Sprites)
  37. 0x43800-0x43bff (128 sprites, 8 bytes every sprite)
  38.  
  39. COLORRAM(Colors)
  40. 0xe0000-0xe07ff (1024 colors, ----BBBBGGGGRRRR)
  41.  
  42. ******************************************************************/
  43.  
  44. #include "driver.h"
  45. #include "vidhrdw/generic.h"
  46. #include "cpu/z80/z80.h"
  47.  
  48. static int cabal_sound_command1, cabal_sound_command2;
  49.  
  50. extern void cabal_vh_screenrefresh( struct osd_bitmap *bitmap, int fullrefresh );
  51.  
  52. static void cabal_init_machine( void ) {
  53.     cabal_sound_command1 = cabal_sound_command2 = 0xff;
  54. }
  55.  
  56. static READ_HANDLER( cabal_background_r ){
  57.     return READ_WORD (&videoram[offset]);
  58. }
  59.  
  60. static WRITE_HANDLER( cabal_background_w ){
  61.     int oldword = READ_WORD(&videoram[offset]);
  62.     int newword = COMBINE_WORD(oldword,data);
  63.     if( oldword != newword ){
  64.         WRITE_WORD(&videoram[offset],newword);
  65.         dirtybuffer[offset/2] = 1;
  66.     }
  67. }
  68.  
  69. /******************************************************************************************/
  70.  
  71.  
  72. static struct YM2151interface ym2151_interface =
  73. {
  74.      1,            /* 1 chip */
  75.      3579580,    /* 3.58 MHZ ? */ /* 4 MHZ in raine */
  76.     { YM3012_VOL(80,MIXER_PAN_LEFT,80,MIXER_PAN_RIGHT) },
  77.      { 0 }
  78. };
  79.  
  80. struct ADPCMinterface adpcm_interface =
  81. {
  82.     2,            /* total number of ADPCM decoders in the machine */
  83.     8000,        /* playback frequency */
  84.     REGION_SOUND1, /* memory region where the samples come from */
  85.     0,            /* initialization function */
  86.     {40,40}
  87. };
  88.  
  89. static void cabal_play_adpcm( int channel, int which ){
  90.     if( which!=0xff ){
  91.         unsigned char *RAM = memory_region(REGION_SOUND1);
  92.         int offset = channel*0x10000;
  93.         int start, len;
  94.  
  95.         which = which&0x7f;
  96.         if( which ){
  97.             which = which*2+0x100;
  98.             start = RAM[offset+which] + 256*RAM[offset+which+1];
  99.             len = (RAM[offset+start]*256 + RAM[offset+start+1])*2;
  100.             start+=2;
  101.             ADPCM_play( channel,offset+start,len );
  102.         }
  103.     }
  104. }
  105.  
  106. static READ_HANDLER( cabal_coin_r ) {
  107.     static int coin = 0;
  108.     int val = readinputport( 3 );
  109.  
  110.     if ( !( val & 0x04 ) ){
  111.         if ( coin == 0 ){
  112.             coin = 1;
  113.             return val;
  114.         }
  115.     } else {
  116.         coin = 0;
  117.     }
  118.  
  119.      return val | 0x04;
  120. }
  121.  
  122. static READ_HANDLER( cabal_io_r ) {
  123.     // logerror("INPUT a000[%02x] \n", offset);
  124.     switch (offset){
  125.         case 0x0: return readinputport(4) + (readinputport(5)<<8); /* DIPSW */
  126.         case 0x8: return 0xff + (readinputport(0)<<8);/* IN0 */
  127.         case 0x10: return readinputport(1) + (readinputport(2)<<8); /* IN1,IN2 */
  128.         default: return (0xffff);
  129.     }
  130. }
  131.  
  132. static WRITE_HANDLER( cabal_sndcmd_w ) {
  133.     switch (offset) {
  134.         case 0x0:
  135.             cabal_sound_command1 = data;
  136.             cpu_cause_interrupt( 1, Z80_NMI_INT );
  137.         break;
  138.  
  139.         case 0x2: /* ?? */
  140.             cabal_sound_command2 = data & 0xff;
  141.         break;
  142.  
  143.         case 0x8: /* ?? */
  144.         break;
  145.     }
  146. }
  147.  
  148. static struct MemoryReadAddress readmem_cpu[] = {
  149.     { 0x00000, 0x3ffff, MRA_ROM },
  150.     { 0x40000, 0x437ff, MRA_RAM },
  151.     { 0x43c00, 0x4ffff, MRA_RAM },
  152.     { 0x43800, 0x43bff, MRA_RAM },
  153.     { 0x60000, 0x607ff, MRA_BANK1 },  /* text layer */
  154.     { 0x80000, 0x801ff, cabal_background_r }, /* background layer */
  155.     { 0x80200, 0x803ff, MRA_BANK2 },
  156.     { 0xa0000, 0xa0012, cabal_io_r },
  157.     { 0xe0000, 0xe07ff, paletteram_word_r },
  158.     { 0xe8000, 0xe800f, cabal_coin_r },
  159.     { -1 }
  160. };
  161. static struct MemoryWriteAddress writemem_cpu[] = {
  162.     { 0x00000, 0x3ffff, MWA_ROM },
  163.     { 0x40000, 0x437ff, MWA_RAM },
  164.     { 0x43800, 0x43bff, MWA_RAM, &spriteram, &spriteram_size },
  165.     { 0x43c00, 0x4ffff, MWA_RAM },
  166.     { 0x60000, 0x607ff, MWA_BANK1, &colorram },
  167.     { 0x80000, 0x801ff, cabal_background_w, &videoram, &videoram_size },
  168.     { 0x80200, 0x803ff, MWA_BANK2 },
  169.     { 0xc0040, 0xc0041, MWA_NOP }, /* ??? */
  170.     { 0xc0080, 0xc0081, MWA_NOP }, /* ??? */
  171.     { 0xe0000, 0xe07ff, paletteram_xxxxBBBBGGGGRRRR_word_w, &paletteram},
  172.     { 0xe8000, 0xe800f, cabal_sndcmd_w },
  173.     { -1 }
  174. };
  175.  
  176. /*********************************************************************/
  177.  
  178. static READ_HANDLER( cabal_snd_r )
  179. {
  180.     switch(offset){
  181.         case 0x08: return cabal_sound_command2;
  182.         case 0x0a: return cabal_sound_command1;
  183.         default: return(0xff);
  184.     }
  185. }
  186.  
  187. static WRITE_HANDLER( cabal_snd_w )
  188. {
  189.     switch( offset ){
  190.         case 0x00: cabal_play_adpcm( 0, data ); break;
  191.         case 0x02: cabal_play_adpcm( 1, data ); break;
  192.      }
  193. }
  194.  
  195. static struct MemoryReadAddress readmem_sound[] =
  196. {
  197.     { 0x0000, 0x1fff, MRA_ROM },
  198.     { 0x2000, 0x2fff, MRA_RAM },
  199.     { 0x4000, 0x400d, cabal_snd_r },
  200.     { 0x400f, 0x400f, YM2151_status_port_0_r },
  201.     { 0x8000, 0xffff, MRA_ROM },
  202.     { -1 }
  203. };
  204.  
  205. static struct MemoryWriteAddress writemem_sound[] =
  206. {
  207.     { 0x0000, 0x1fff, MWA_ROM },
  208.     { 0x2000, 0x2fff, MWA_RAM },
  209.     { 0x4000, 0x400d, cabal_snd_w },
  210.     { 0x400e, 0x400e, YM2151_register_port_0_w },
  211.     { 0x400f, 0x400f, YM2151_data_port_0_w },
  212.     { 0x6000, 0x6000, MWA_NOP },  /*???*/
  213.     { 0x8000, 0xffff, MWA_ROM },
  214.      { -1 }
  215. };
  216.  
  217. static struct MemoryReadAddress cabalbl_readmem_sound[] =
  218. {
  219.     { 0x0000, 0x1fff, MRA_ROM },
  220.     { 0x2000, 0x2fff, MRA_RAM },
  221.     { 0x4000, 0x400d, cabal_snd_r },
  222.     { 0x400f, 0x400f, YM2151_status_port_0_r },
  223.     { 0x8000, 0xffff, MRA_ROM },
  224.     { -1 }
  225. };
  226.  
  227. static struct MemoryWriteAddress cabalbl_writemem_sound[] =
  228. {
  229.     { 0x0000, 0x1fff, MWA_ROM },
  230.     { 0x2000, 0x2fff, MWA_RAM },
  231.     { 0x4000, 0x400d, cabal_snd_w },
  232.     { 0x400e, 0x400e, YM2151_register_port_0_w },
  233.     { 0x400f, 0x400f, YM2151_data_port_0_w },
  234.     { 0x6000, 0x6000, MWA_NOP },  /*???*/
  235.     { 0x8000, 0xffff, MWA_ROM },
  236.     { -1 }
  237. };
  238.  
  239. /* ADPCM CPU (common) */
  240.  
  241. #if 0
  242. static struct MemoryReadAddress cabalbl_readmem_adpcm[] = {
  243.     { 0x0000, 0xffff, MRA_ROM },
  244.     { -1 }
  245. };
  246. static struct MemoryWriteAddress cabalbl_writemem_adpcm[] = {
  247.     { 0x0000, 0xffff, MWA_NOP },
  248.     { -1 }
  249. };
  250. #endif
  251.  
  252.  
  253. /***************************************************************************/
  254.  
  255. INPUT_PORTS_START( cabal )
  256.     PORT_START    /* IN0 */
  257.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY)
  258.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY)
  259.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY)
  260.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
  261.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  262.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  263.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  264.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  265.  
  266.     PORT_START    /* IN1 */
  267.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  268.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  269.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  270.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  271.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  272.  
  273.     PORT_START    /* IN2 */
  274.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  275.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2)
  276.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
  277.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  278.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  279.  
  280.     PORT_START    /* IN3 */
  281.     PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN )
  282.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
  283.     PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
  284.  
  285.     PORT_START    /* DIPSW1 */
  286.     PORT_DIPNAME( 0x0f, 0x0e, DEF_STR( Coinage ) )
  287.     PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )
  288.     PORT_DIPSETTING(    0x0b, "3 Coins/1 Credit 5/2" )
  289.     PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ) )
  290.     PORT_DIPSETTING(    0x0d, "2 Coins/1 Credit 3/2" )
  291.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  292.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_1C ) )
  293.     PORT_DIPSETTING(    0x03, "2 Coins/2 Credits 3/4" )
  294.     PORT_DIPSETTING(    0x02, DEF_STR( 3C_3C ) )
  295.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_2C ) )
  296.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
  297.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_4C ) )
  298.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
  299.     PORT_DIPSETTING(    0x07, DEF_STR( 1C_8C ) )
  300.     PORT_DIPSETTING(    0x06, "1 Coin/10 Credits" )
  301.     PORT_DIPSETTING(    0x05, "1 Coin/12 Credits" )
  302.     PORT_DIPSETTING(    0x00, "Free 99 Credits" )
  303. /* 0x10 is different from the Free 99 Credits.
  304.    When you start the game the credits decrease using the Free 99,
  305.    while they stay at 99 using the 0x10 dip. */
  306.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Free_Play ) )
  307.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  308.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  309.     PORT_DIPNAME( 0x20, 0x20, "Invert Buttons" )
  310.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  311.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  312.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  313.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  314.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  315.     PORT_DIPNAME( 0x80, 0x80, "Trackball" )
  316.     PORT_DIPSETTING(    0x80, "Small" )
  317.     PORT_DIPSETTING(    0x00, "Large" )
  318.  
  319.     PORT_START    /* DIPSW2 */
  320.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  321.     PORT_DIPSETTING(    0x02, "2" )
  322.     PORT_DIPSETTING(    0x03, "3" )
  323.     PORT_DIPSETTING(    0x01, "5" )
  324.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  325.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
  326.     PORT_DIPSETTING(    0x0c, "20k 50k" )
  327.     PORT_DIPSETTING(    0x08, "30k 100k" )
  328.     PORT_DIPSETTING(    0x04, "50k 150k" )
  329.     PORT_DIPSETTING(    0x00, "70K" )
  330.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
  331.     PORT_DIPSETTING(    0x30, "Easy" )
  332.     PORT_DIPSETTING(    0x20, "Normal" )
  333.     PORT_DIPSETTING(    0x10, "Hard" )
  334.     PORT_DIPSETTING(    0x00, "Very Hard" )
  335.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  336.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  337.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  338.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  339.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  340.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  341. INPUT_PORTS_END
  342.  
  343.  
  344.  
  345. static struct GfxLayout text_layout =
  346. {
  347.     8,8,    /* 8*8 characters */
  348.     1024,    /* 1024 characters */
  349.     2,    /* 4 bits per pixel */
  350.     { 0,4 },//0x4000*8+0, 0x4000*8+4, 0, 4 },
  351.     { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0},
  352.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  353.     16*8    /* every char takes 16 consecutive bytes */
  354. };
  355.  
  356. static struct GfxLayout tile_layout =
  357. {
  358.     16,16,  /* 16*16 tiles */
  359.     4*1024,   /* 1024 tiles */
  360.     4,      /* 4 bits per pixel */
  361.     { 0, 4, 0x40000*8+0, 0x40000*8+4 },
  362.     { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0,
  363.             32*8+3, 32*8+2, 32*8+1, 32*8+0, 33*8+3, 33*8+2, 33*8+1, 33*8+0 },
  364.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  365.             8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
  366.     64*8
  367. };
  368.  
  369. static struct GfxLayout sprite_layout =
  370. {
  371.     16,16,    /* 16*16 sprites */
  372.     4*1024,    /* 1024 sprites */
  373.     4,    /* 4 bits per pixel */
  374.     { 0, 4, 0x40000*8+0, 0x40000*8+4 },    /* the two bitplanes for 4 pixels are packed into one byte */
  375.     { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0,
  376.             16+3, 16+2, 16+1, 16+0, 24+3, 24+2, 24+1, 24+0 },
  377.     { 30*16, 28*16, 26*16, 24*16, 22*16, 20*16, 18*16, 16*16,
  378.             14*16, 12*16, 10*16,  8*16,  6*16,  4*16,  2*16,  0*16 },
  379.     64*8    /* every sprite takes 64 consecutive bytes */
  380. };
  381.  
  382. static struct GfxDecodeInfo cabal_gfxdecodeinfo[] = {
  383.     { REGION_GFX1, 0, &text_layout,        0, 1024/4 },
  384.     { REGION_GFX2, 0, &tile_layout,        32*16, 16 },
  385.     { REGION_GFX3, 0, &sprite_layout,    16*16, 16 },
  386.     { -1 }
  387. };
  388.  
  389. static struct MachineDriver machine_driver_cabal =
  390. {
  391.     {
  392.         {
  393.             CPU_M68000,
  394.             12000000, /* 12 Mhz */
  395.             readmem_cpu,writemem_cpu,0,0,
  396.             m68_level1_irq,1
  397.         },
  398.         {
  399.             CPU_Z80 | CPU_AUDIO_CPU,
  400.             4000000,    /* 4 Mhz */
  401.             readmem_sound,writemem_sound,0,0,
  402.             interrupt,1
  403.         },
  404.     },
  405.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  406.     1, /* CPU slices per frame */
  407.     cabal_init_machine, /* init machine */
  408.  
  409.     /* video hardware */
  410.     256, 256, { 0, 255, 16, 255-16 },
  411.  
  412.     cabal_gfxdecodeinfo,
  413.     1024,1024,
  414.     0,
  415.  
  416.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  417.     0,
  418.     generic_vh_start,
  419.     generic_vh_stop,
  420.     cabal_vh_screenrefresh,
  421.  
  422.     /* sound hardware */
  423.     0,0,0,0,
  424. };
  425.  
  426. static struct MachineDriver machine_driver_cabalbl =
  427. {
  428.     {
  429.         {
  430.             CPU_M68000,
  431.             12000000, /* 12 Mhz */
  432.             readmem_cpu,writemem_cpu,0,0,
  433.             m68_level1_irq,1
  434.         },
  435.         {
  436.             CPU_Z80 | CPU_AUDIO_CPU,
  437.             4000000,    /* 4 Mhz */
  438.             cabalbl_readmem_sound,cabalbl_writemem_sound,0,0,
  439.             interrupt,1
  440.         },
  441.     },
  442.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  443.     10, /* CPU slices per frame */
  444.     cabal_init_machine, /* init machine */
  445.  
  446.     /* video hardware */
  447.     256, 256, { 0, 255, 16, 255-16 },
  448.  
  449.     cabal_gfxdecodeinfo,
  450.     1024,1024,
  451.     0,
  452.  
  453.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  454.     0,
  455.     generic_vh_start,
  456.     generic_vh_stop,
  457.     cabal_vh_screenrefresh,
  458.  
  459.     /* sound hardware */
  460.     SOUND_SUPPORTS_STEREO,0,0,0,
  461.     {
  462.         {
  463.             SOUND_YM2151,//_ALT,
  464.             &ym2151_interface
  465.         },
  466.         {
  467.             SOUND_ADPCM,
  468.             &adpcm_interface
  469.         }
  470.     }
  471. };
  472.  
  473. ROM_START( cabal )
  474.     ROM_REGION( 0x50000, REGION_CPU1 )    /* 64k for cpu code */
  475.     ROM_LOAD_EVEN( "h7_512.bin",      0x00000, 0x10000, 0x8fe16fb4 )
  476.     ROM_LOAD_ODD ( "h6_512.bin",      0x00000, 0x10000, 0x6968101c )
  477.     ROM_LOAD_EVEN( "k7_512.bin",      0x20000, 0x10000, 0x562031a2 )
  478.     ROM_LOAD_ODD ( "k6_512.bin",      0x20000, 0x10000, 0x4fda2856 )
  479.  
  480.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu code */
  481.     ROM_LOAD( "4-3n",           0x0000, 0x2000, 0x4038eff2 )
  482.     ROM_LOAD( "3-3p",           0x8000, 0x8000, 0xd9defcbf )
  483.  
  484.     ROM_REGION( 0x4000,  REGION_GFX1 | REGIONFLAG_DISPOSE )
  485.     ROM_LOAD( "t6_128.bin",     0x00000, 0x04000, 0x1ccee214 ) /* characters */
  486.  
  487.     /* the gfx ROMs were missing in this set, I'm using the ones from */
  488.     /* the bootleg */
  489.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  490.     ROM_LOAD( "cabal_17.bin",   0x00000, 0x10000, 0x3b6d2b09 ) /* tiles, planes0,1 */
  491.     ROM_LOAD( "cabal_16.bin",   0x10000, 0x10000, 0x77bc7a60 )
  492.     ROM_LOAD( "cabal_18.bin",   0x20000, 0x10000, 0x0bc50075 )
  493.     ROM_LOAD( "cabal_19.bin",   0x30000, 0x10000, 0x67e4fe47 )
  494.     ROM_LOAD( "cabal_15.bin",   0x40000, 0x10000, 0x1023319b ) /* tiles, planes2,3 */
  495.     ROM_LOAD( "cabal_14.bin",   0x50000, 0x10000, 0x420b0801 )
  496.     ROM_LOAD( "cabal_12.bin",   0x60000, 0x10000, 0x543fcb37 )
  497.     ROM_LOAD( "cabal_13.bin",   0x70000, 0x10000, 0xd28d921e )
  498.  
  499.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  500.     ROM_LOAD( "cabal_05.bin",   0x00000, 0x10000, 0x4e49c28e ) /* sprites, planes0,1 */
  501.     ROM_LOAD( "cabal_06.bin",   0x10000, 0x10000, 0x6a0e739d )
  502.     ROM_LOAD( "cabal_07.bin",   0x20000, 0x10000, 0x581a50c1 )
  503.     ROM_LOAD( "cabal_08.bin",   0x30000, 0x10000, 0x702735c9 )
  504.     ROM_LOAD( "cabal_04.bin",   0x40000, 0x10000, 0x34d3cac8 ) /* sprites, planes2,3 */
  505.     ROM_LOAD( "cabal_03.bin",   0x50000, 0x10000, 0x7065e840 )
  506.     ROM_LOAD( "cabal_02.bin",   0x60000, 0x10000, 0x0e1ec30e )
  507.     ROM_LOAD( "cabal_01.bin",   0x70000, 0x10000, 0x55c44764 )
  508.  
  509.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* Samples? */
  510.     ROM_LOAD( "2-1s",           0x00000, 0x10000, 0x850406b4 )
  511.     ROM_LOAD( "1-1u",           0x10000, 0x10000, 0x8b3e0789 )
  512. ROM_END
  513.  
  514. ROM_START( cabal2 )
  515.     ROM_REGION( 0x50000, REGION_CPU1 )    /* 64k for cpu code */
  516.     ROM_LOAD_EVEN( "9-7h",            0x00000, 0x10000, 0xebbb9484 )
  517.     ROM_LOAD_ODD ( "7-6h",            0x00000, 0x10000, 0x51aeb49e )
  518.     ROM_LOAD_EVEN( "8-7k",            0x20000, 0x10000, 0x4c24ed9a )
  519.     ROM_LOAD_ODD ( "6-6k",            0x20000, 0x10000, 0x681620e8 )
  520.  
  521.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu code */
  522.     ROM_LOAD( "4-3n",           0x0000, 0x2000, 0x4038eff2 )
  523.     ROM_LOAD( "3-3p",           0x8000, 0x8000, 0xd9defcbf )
  524.  
  525.     ROM_REGION( 0x4000,  REGION_GFX1 | REGIONFLAG_DISPOSE )
  526.     ROM_LOAD( "5-6s",           0x00000, 0x04000, 0x6a76955a ) /* characters */
  527.  
  528.     /* the gfx ROMs were missing in this set, I'm using the ones from */
  529.     /* the bootleg */
  530.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  531.     ROM_LOAD( "cabal_17.bin",   0x00000, 0x10000, 0x3b6d2b09 ) /* tiles, planes0,1 */
  532.     ROM_LOAD( "cabal_16.bin",   0x10000, 0x10000, 0x77bc7a60 )
  533.     ROM_LOAD( "cabal_18.bin",   0x20000, 0x10000, 0x0bc50075 )
  534.     ROM_LOAD( "cabal_19.bin",   0x30000, 0x10000, 0x67e4fe47 )
  535.     ROM_LOAD( "cabal_15.bin",   0x40000, 0x10000, 0x1023319b ) /* tiles, planes2,3 */
  536.     ROM_LOAD( "cabal_14.bin",   0x50000, 0x10000, 0x420b0801 )
  537.     ROM_LOAD( "cabal_12.bin",   0x60000, 0x10000, 0x543fcb37 )
  538.     ROM_LOAD( "cabal_13.bin",   0x70000, 0x10000, 0xd28d921e )
  539.  
  540.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  541.     ROM_LOAD( "cabal_05.bin",   0x00000, 0x10000, 0x4e49c28e ) /* sprites, planes0,1 */
  542.     ROM_LOAD( "cabal_06.bin",   0x10000, 0x10000, 0x6a0e739d )
  543.     ROM_LOAD( "cabal_07.bin",   0x20000, 0x10000, 0x581a50c1 )
  544.     ROM_LOAD( "cabal_08.bin",   0x30000, 0x10000, 0x702735c9 )
  545.     ROM_LOAD( "cabal_04.bin",   0x40000, 0x10000, 0x34d3cac8 ) /* sprites, planes2,3 */
  546.     ROM_LOAD( "cabal_03.bin",   0x50000, 0x10000, 0x7065e840 )
  547.     ROM_LOAD( "cabal_02.bin",   0x60000, 0x10000, 0x0e1ec30e )
  548.     ROM_LOAD( "cabal_01.bin",   0x70000, 0x10000, 0x55c44764 )
  549.  
  550.     ROM_REGION( 0x20000, REGION_SOUND1 )    /* Samples? */
  551.     ROM_LOAD( "2-1s",           0x00000, 0x10000, 0x850406b4 )
  552.     ROM_LOAD( "1-1u",           0x10000, 0x10000, 0x8b3e0789 )
  553. ROM_END
  554.  
  555. ROM_START( cabalbl )
  556.     ROM_REGION( 0x50000, REGION_CPU1 )    /* 64k for cpu code */
  557.     ROM_LOAD_EVEN( "cabal_24.bin",    0x00000, 0x10000, 0x00abbe0c )
  558.     ROM_LOAD_ODD ( "cabal_22.bin",    0x00000, 0x10000, 0x78c4af27 )
  559.     ROM_LOAD_EVEN( "cabal_23.bin",    0x20000, 0x10000, 0xd763a47c )
  560.     ROM_LOAD_ODD ( "cabal_21.bin",    0x20000, 0x10000, 0x96d5e8af )
  561.  
  562.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu code */
  563.     ROM_LOAD( "cabal_11.bin",    0x0000, 0x10000, 0xd308a543 )
  564.  
  565.     ROM_REGION( 0x4000,  REGION_GFX1 | REGIONFLAG_DISPOSE )
  566.     ROM_LOAD( "5-6s",           0x00000, 0x04000, 0x6a76955a ) /* characters */
  567.  
  568.     ROM_REGION( 0x80000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  569.     ROM_LOAD( "cabal_17.bin",   0x00000, 0x10000, 0x3b6d2b09 ) /* tiles, planes0,1 */
  570.     ROM_LOAD( "cabal_16.bin",   0x10000, 0x10000, 0x77bc7a60 )
  571.     ROM_LOAD( "cabal_18.bin",   0x20000, 0x10000, 0x0bc50075 )
  572.     ROM_LOAD( "cabal_19.bin",   0x30000, 0x10000, 0x67e4fe47 )
  573.     ROM_LOAD( "cabal_15.bin",   0x40000, 0x10000, 0x1023319b ) /* tiles, planes2,3 */
  574.     ROM_LOAD( "cabal_14.bin",   0x50000, 0x10000, 0x420b0801 )
  575.     ROM_LOAD( "cabal_12.bin",   0x60000, 0x10000, 0x543fcb37 )
  576.     ROM_LOAD( "cabal_13.bin",   0x70000, 0x10000, 0xd28d921e )
  577.  
  578.     ROM_REGION( 0x80000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  579.     ROM_LOAD( "cabal_05.bin",   0x00000, 0x10000, 0x4e49c28e ) /* sprites, planes0,1 */
  580.     ROM_LOAD( "cabal_06.bin",   0x10000, 0x10000, 0x6a0e739d )
  581.     ROM_LOAD( "cabal_07.bin",   0x20000, 0x10000, 0x581a50c1 )
  582.     ROM_LOAD( "cabal_08.bin",   0x30000, 0x10000, 0x702735c9 )
  583.     ROM_LOAD( "cabal_04.bin",   0x40000, 0x10000, 0x34d3cac8 ) /* sprites, planes2,3 */
  584.     ROM_LOAD( "cabal_03.bin",   0x50000, 0x10000, 0x7065e840 )
  585.     ROM_LOAD( "cabal_02.bin",   0x60000, 0x10000, 0x0e1ec30e )
  586.     ROM_LOAD( "cabal_01.bin",   0x70000, 0x10000, 0x55c44764 )
  587.  
  588.     ROM_REGION( 0x20000, REGION_SOUND1 )
  589.     ROM_LOAD( "cabal_09.bin",   0x00000, 0x10000, 0x4ffa7fe3 ) /* Z80 code/adpcm data */
  590.     ROM_LOAD( "cabal_10.bin",   0x10000, 0x10000, 0x958789b6 ) /* Z80 code/adpcm data */
  591. ROM_END
  592.  
  593.  
  594.  
  595. GAMEX( 1988, cabal,   0,     cabal,   cabal, 0, ROT0, "Tad (Fabtek license)", "Cabal (US set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL )
  596. GAMEX( 1988, cabal2,  cabal, cabal,   cabal, 0, ROT0, "Tad (Fabtek license)", "Cabal (US set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL )
  597. GAMEX( 1988, cabalbl, cabal, cabalbl, cabal, 0, ROT0, "bootleg", "Cabal (bootleg)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL )
  598.